<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">

<link href="css/redmond/jquery-ui-1.10.3.custom.min.css"
	rel="stylesheet" type="text/css">
<!-- jquery UI CSS函式庫 -->
<link href="css/selfTemplate.css" rel="stylesheet" type="text/css">
<!-- 自建CSS函式庫 -->

<script src="js/jquery-1.10.2.min.js" type="text/javascript"></script>
<!-- jquery 函式庫 -->
<script src="js/jquery-ui-1.10.3.custom.js" type="text/javascript"></script>
<!-- jquery UI 函式庫 -->


<script type="text/javascript">

/**	錯誤訊息產生 **/
//自行維護的錯誤訊息
function errorMsgShow(shortMsg,longMsg) {
	if ( undefined==shortMsg && undefined==longMsg ) {	//兩個都沒有
		$("#errShortMsg").html("woops!  We've got some problem. Please contact the administrator.");
		$("#errLongMsg").html(null);
	} else if ( undefined!=shortMsg && undefined==longMsg ) {	//只有短訊息
		$("#errShortMsg").html(shortMsg);
		$("#errLongMsg").html(null);
	} else {	//兩個都有
		$("#errShortMsg").html(shortMsg);
		$("#errLongMsg").html(longMsg);
	}
}



	$(document).ready(function() {
		/* $(document).on("click", "a.fileDownloadPromise", function () {
		    $.fileDownload($(this).prop('href'))
		        .done(function () { alert('File download a success!'); })
		        .fail(function () { alert('File download failed!'); });
		 
		    return false; //this is critical to stop the click event which will trigger a normal file download
		}); */
		 $("#mm").bind("click", function() {
			 $.ajax({
				type : "post",
				url : "TestFunction",
				//data: {"name":"TESTModule","mode":"copy","from":"WARModule"},
				async : false,
				success : function(reses) {
				}, error : function(xhr, ajaxOptions, thrownError) {
					errorMsgShow(xhr);
				}
			});
		}); 
		

		$("#xm").bind("click", function() {

			//var tmp = "<?xml version='1.0' encoding='UTF-8'?><maven2-moduleset plugin='maven-plugin@2.0-beta-1'><actions/><description></description><keepDependencies>false</keepDependencies><properties/><scm class='hudson.scm.SubversionSCM' plugin='subversion@1.53'><locations><hudson.scm.SubversionSCM_-ModuleLocation><remote>http://10.144.136.56/svntest/arthur/EJBModule</remote>        <local>.</local>        <depthOption>infinity</depthOption>        <ignoreExternalsOption>false</ignoreExternalsOption>      </hudson.scm.SubversionSCM_-ModuleLocation>    </locations>    <excludedRegions></excludedRegions>    <includedRegions></includedRegions>    <excludedUsers></excludedUsers>    <excludedRevprop></excludedRevprop>    <excludedCommitMessages></excludedCommitMessages>    <workspaceUpdater class='hudson.scm.subversion.CheckoutUpdater'/>    <ignoreDirPropChanges>false</ignoreDirPropChanges>    <filterChangelog>false</filterChangelog>  </scm>  <canRoam>true</canRoam>  <disabled>false</disabled>  <blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding>  <blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding>  <triggers/>  <concurrentBuild>false</concurrentBuild>  <rootModule>    <groupId>com.theopentutorials.ejb3</groupId>    <artifactId>ejbmavendemo</artifactId>  </rootModule>  <goals>clean install deploy</goals>  <aggregatorStyleBuild>true</aggregatorStyleBuild>  <incrementalBuild>false</incrementalBuild>  <perModuleEmail>true</perModuleEmail>  <ignoreUpstremChanges>true</ignoreUpstremChanges>  <archivingDisabled>false</archivingDisabled>  <resolveDependencies>false</resolveDependencies>  <processPlugins>false</processPlugins>  <mavenValidationLevel>-1</mavenValidationLevel>  <runHeadless>false</runHeadless>  <disableTriggerDownstreamProjects>false</disableTriggerDownstreamProjects>  <settings class='jenkins.mvn.DefaultSettingsProvider'/>  <globalSettings class='jenkins.mvn.DefaultGlobalSettingsProvider'/>  <reporters/>  <publishers>    <hudson.tasks.BuildTrigger>      <childProjects>WARModule</childProjects>      <threshold>        <name>SUCCESS</name>        <ordinal>0</ordinal>        <color>BLUE</color>        <completeBuild>true</completeBuild>      </threshold>    </hudson.tasks.BuildTrigger>  </publishers>  <buildWrappers/>  <prebuilders/>  <postbuilders/>  <runPostStepsIfResult>    <name>FAILURE</name>    <ordinal>2</ordinal>    <color>RED</color>    <completeBuild>true</completeBuild>  </runPostStepsIfResult></maven2-moduleset>";
			
									
			$.ajax({
				type : "post",
				url : "http://10.144.97.100:8080/jenkins/createItem",
				data: {"name":"TESTModule","mode":"copy","from":"WARModule"},
				async : false,
				success : function(reses) {
				}, error : function(xhr, ajaxOptions, thrownError) {
					errorMsgShow(xhr);
				}
			});
		});

		$("#rm").bind("click", function() {
			//var tmp = "<?xml version='1.0' encoding='UTF-8'?><maven2-moduleset plugin='maven-plugin@2.0-beta-1'><actions/><description></description><keepDependencies>false</keepDependencies><properties/><scm class='hudson.scm.SubversionSCM' plugin='subversion@1.53'><locations><hudson.scm.SubversionSCM_-ModuleLocation><remote>http://10.144.136.56/svntest/arthur/EJBModule</remote>        <local>.</local>        <depthOption>infinity</depthOption>        <ignoreExternalsOption>false</ignoreExternalsOption>      </hudson.scm.SubversionSCM_-ModuleLocation>    </locations>    <excludedRegions></excludedRegions>    <includedRegions></includedRegions>    <excludedUsers></excludedUsers>    <excludedRevprop></excludedRevprop>    <excludedCommitMessages></excludedCommitMessages>    <workspaceUpdater class='hudson.scm.subversion.CheckoutUpdater'/>    <ignoreDirPropChanges>false</ignoreDirPropChanges>    <filterChangelog>false</filterChangelog>  </scm>  <canRoam>true</canRoam>  <disabled>false</disabled>  <blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding>  <blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding>  <triggers/>  <concurrentBuild>false</concurrentBuild>  <rootModule>    <groupId>com.theopentutorials.ejb3</groupId>    <artifactId>ejbmavendemo</artifactId>  </rootModule>  <goals>clean install deploy</goals>  <aggregatorStyleBuild>true</aggregatorStyleBuild>  <incrementalBuild>false</incrementalBuild>  <perModuleEmail>true</perModuleEmail>  <ignoreUpstremChanges>true</ignoreUpstremChanges>  <archivingDisabled>false</archivingDisabled>  <resolveDependencies>false</resolveDependencies>  <processPlugins>false</processPlugins>  <mavenValidationLevel>-1</mavenValidationLevel>  <runHeadless>false</runHeadless>  <disableTriggerDownstreamProjects>false</disableTriggerDownstreamProjects>  <settings class='jenkins.mvn.DefaultSettingsProvider'/>  <globalSettings class='jenkins.mvn.DefaultGlobalSettingsProvider'/>  <reporters/>  <publishers>    <hudson.tasks.BuildTrigger>      <childProjects>WARModule</childProjects>      <threshold>        <name>SUCCESS</name>        <ordinal>0</ordinal>        <color>BLUE</color>        <completeBuild>true</completeBuild>      </threshold>    </hudson.tasks.BuildTrigger>  </publishers>  <buildWrappers/>  <prebuilders/>  <postbuilders/>  <runPostStepsIfResult>    <name>FAILURE</name>    <ordinal>2</ordinal>    <color>RED</color>    <completeBuild>true</completeBuild>  </runPostStepsIfResult></maven2-moduleset>";
			$.ajax({
				type : "post",
				
				//url : "http://10.144.97.100:8080/jenkins/job/EJBModule/16/api/json", 
		url : "http://10.144.97.100:8080/jenkins/job/MR_BL_DevOps/build?token=MR_BL_DevOps&cause=whatthewonderfullworld",
				//url : "http://10.144.97.100:8080/jenkins/job/EJBModule/buildWithParameters?token=sec\&HAHA=vivian",
				async : false,
				success : function(reses) {
					alert(reses);
				}, error : function(xhr, ajaxOptions, thrownError) {
					errorMsgShow(xhr);
				}
			});
		});
		
		$("#um").bind("click", function() {
			//var tmp = "<?xml version='1.0' encoding='UTF-8'?><maven2-moduleset plugin='maven-plugin@2.0-beta-1'><actions/><description></description><keepDependencies>false</keepDependencies><properties/><scm class='hudson.scm.SubversionSCM' plugin='subversion@1.53'><locations><hudson.scm.SubversionSCM_-ModuleLocation><remote>http://10.144.136.56/svntest/arthur/EJBModule</remote>        <local>.</local>        <depthOption>infinity</depthOption>        <ignoreExternalsOption>false</ignoreExternalsOption>      </hudson.scm.SubversionSCM_-ModuleLocation>    </locations>    <excludedRegions></excludedRegions>    <includedRegions></includedRegions>    <excludedUsers></excludedUsers>    <excludedRevprop></excludedRevprop>    <excludedCommitMessages></excludedCommitMessages>    <workspaceUpdater class='hudson.scm.subversion.CheckoutUpdater'/>    <ignoreDirPropChanges>false</ignoreDirPropChanges>    <filterChangelog>false</filterChangelog>  </scm>  <canRoam>true</canRoam>  <disabled>false</disabled>  <blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding>  <blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding>  <triggers/>  <concurrentBuild>false</concurrentBuild>  <rootModule>    <groupId>com.theopentutorials.ejb3</groupId>    <artifactId>ejbmavendemo</artifactId>  </rootModule>  <goals>clean install deploy</goals>  <aggregatorStyleBuild>true</aggregatorStyleBuild>  <incrementalBuild>false</incrementalBuild>  <perModuleEmail>true</perModuleEmail>  <ignoreUpstremChanges>true</ignoreUpstremChanges>  <archivingDisabled>false</archivingDisabled>  <resolveDependencies>false</resolveDependencies>  <processPlugins>false</processPlugins>  <mavenValidationLevel>-1</mavenValidationLevel>  <runHeadless>false</runHeadless>  <disableTriggerDownstreamProjects>false</disableTriggerDownstreamProjects>  <settings class='jenkins.mvn.DefaultSettingsProvider'/>  <globalSettings class='jenkins.mvn.DefaultGlobalSettingsProvider'/>  <reporters/>  <publishers>    <hudson.tasks.BuildTrigger>      <childProjects>WARModule</childProjects>      <threshold>        <name>SUCCESS</name>        <ordinal>0</ordinal>        <color>BLUE</color>        <completeBuild>true</completeBuild>      </threshold>    </hudson.tasks.BuildTrigger>  </publishers>  <buildWrappers/>  <prebuilders/>  <postbuilders/>  <runPostStepsIfResult>    <name>FAILURE</name>    <ordinal>2</ordinal>    <color>RED</color>    <completeBuild>true</completeBuild>  </runPostStepsIfResult></maven2-moduleset>";
			$.ajax({
				type : "post",
				url : "http://10.144.97.100:8080/jenkins/job/EJBModule/buildWithParameters?token=sec\&HAHA=vivian",
				async : false,
				success : function(reses) {
				}, error : function(xhr, ajaxOptions, thrownError) {
					errorMsgShow(xhr);
				}
			});
		});
		
		
		$("button").button();
	});
</script>
</head>
<body>
<a href="TestFunction" class="fileDownloadPromise">Report0.pdf</a>

	<button id="mm" type="button">GO</button>
	<p>

	<button id="xm" type="button">xml</button>
	
	<p>

	<button id="rm" type="button">呼叫Build版</button>
	
	<p>

	<button id="rm" type="button">更新EJBModule的內容</button>
	
	
	<div id='errShortMsg' ></div>
</body>

</html>